import { get, post, uploadFile } from '@/plugins/axios'
import { URL_PREFIX } from '../index'

/* 返回对话id post请求 */
export const postDialogueID = () => post(URL_PREFIX + '/myapp/api/dia/adddia')

/* 
选择了深度思考，并且没有上传附件，图片
返回思考推理过程
*/
export const postChatFlux = (data, config = {}) => post(URL_PREFIX + '/myapp/api/chat/flux', data, config)

/* 
没有选择深度思考，则是简单对话回答问题
*/
export const postChatAsk = data => post(URL_PREFIX + '/myapp/api/ai/ask ', data)

/* 
左侧加载历史对话接口
*/
export const getDialogueHistory = params => get(URL_PREFIX + '/myapp/api/dialogues/history', params)

/* 
左侧历史对话列表点击后，需要查询该对话曾经查询过的对话问题。
*/
export const getSearchHisDialogue = params => get(URL_PREFIX + '/myapp/api/search/hisdialogue', params)

/* 
上传图片
*/
export const uploadParseImage = (file, data) => uploadFile(URL_PREFIX + '/myapp/api/ocr/parse-image', file, data)

/* 上传附件 */
export const uploadParseFile = (file, data) => uploadFile(URL_PREFIX + '/myapp/api/file/parse-file', file, data)

/* 根据关键词检索相关附件 */
export const searchFileBykw = params => get(URL_PREFIX + '/myapp/api/file/search-file', params)

